package picasa;


import java.awt.image.*;


public class ColorFilter extends RGBImageFilter {

	String color;
  public ColorFilter(String color) {
	  this.color=color;
      canFilterIndexColorModel = true;
  }

  public int filterRGB(int x, int y, int rgb) {
	if (color.equals("blue"))
	  return rgb & 0xFF0000FF;
	else if (color.equals("green"))
		  return rgb & 0xFF00FF00;
	else //red
		  return rgb & 0xFFFF0000;
	
  }
}
